/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.statistics;

import com.enation.app.javashop.client.statistics.DisplayTimesClient;
import com.enation.app.javashop.core.client.fallback.statistics.DisplayTimesClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.statistics.dos.GoodsPageView;
import com.enation.app.javashop.model.statistics.dos.ShopPageView;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 访问次数client
 *
 * @author fk
 * @version v1.0
 * @Description:
 * @since v7.0
 * 2020/3/20 上午8:21
 */
@FeignClient(name = "statistics-service",fallbackFactory = DisplayTimesClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface DisplayTimesClientFeignImpl extends DisplayTimesClient {

    /**
     * 立即整理现有的数据
     */
    @Override
    @RequestMapping(value = "/client/statistics/display-times/count-all", method = RequestMethod.POST)
    void countNow();

    /**
     * 将统计好的店铺数据 写入数据库
     *
     * @param list
     */
    @Override
    @RequestMapping(value = "/client/statistics/display-times/count-shop", method = RequestMethod.POST)
    void countShop(@RequestBody List<ShopPageView> list);

    /**
     * 将统计好的商品数据 写入数据库
     *
     * @param list
     */
    @Override
    @RequestMapping(value = "/client/statistics/display-times/count-goods", method = RequestMethod.POST)
    void countGoods(@RequestBody List<GoodsPageView> list);
}
